var a = getApp();

Page({
    data: {
        nickname: "",
        avatar_image: "",
        agent_count: "",
        grand_amount: "",
        page: 1,
        isLoadMore: !1,
        last_page: 1,
        list: []
    },
    onLoad: function(a) {
        this.getData();
    },
    getData: function() {
        var t = this;
        a._postNetWork({
            url: a.getNetAddresss("plugin.area-merchant.frontend.modules.bonus.controllers.records.index"),
            success: function(a) {
                console.log(a);
                var n = a.data.data, e = n.nickname, o = n.avatar_image, s = n.agent_count, i = n.grand_amount, r = n.page_list;
                1 == a.data.result && t.setData({
                    nickname: e,
                    avatar_image: o,
                    agent_count: s,
                    grand_amount: i,
                    last_page: r.last_page,
                    list: r.data
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.getMoreData();
    },
    getMoreData: function() {
        var t = this, n = this.data.page + 1;
        a._postNetWork({
            url: a.getNetAddresss("plugin.area-merchant.frontend.modules.bonus.controllers.records.index"),
            data: {
                page: n
            },
            success: function(a) {
                var e = a.data.data.page_list;
                if (1 == a.data.result) {
                    var o = t.data.list.concat(e.data);
                    t.setData({
                        page: n,
                        last_page: e.last_page,
                        list: o
                    });
                }
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    onShareAppMessage: function() {}
});